import { RouteRecordRaw } from 'vue-router'
import { RouterTransition } from '@/components/transition'

const routeName = 'data'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/data',
    name: routeName,
    redirect: '/data/summary',
    component: RouterTransition,
    meta: {
      title: '数据',
      icon: 'icon-linechart'
    },
    children: [{
      path: 'summary',
      name: `${routeName}-summary`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/data/summary/summary.vue'),
      meta: {
        title: '数据概览',
      },
    }, {
      path: 'owner',
      name: `${routeName}-owner`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/data/owner/owner.vue'),
      meta: {
        title: '我的数据',
      },
    }, {
      path: 'analysis',
      name: `${routeName}-analysis`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/data/analysis/analysis.vue'),
      meta: {
        title: '报表分析',
      },
    }, {
      path: 'schedule',
      name: `${routeName}-schedule`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/data/schedule/index.vue'),
      meta: {
        title: '课表查看',
      },
    }, {
      path: 'schedule/find',
      name: `${routeName}-schedule-find`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/data/schedule/schedule-find.vue'),
      meta: {
        title: '课表查看',
        hidden: true
      },
    }, {
      path: 'schedule/edit',
      name: `${routeName}-schedule-edit`,
      component: () => import(/* webpackChunkName: "system" */ '@/views/data/schedule/schedule-add.vue'),
      meta: {
        title: '课表编辑',
        hidden: true
      },
    }]
  }
]

export default routes
